﻿#include"mySet.h"
#include"myMap.h"

int main()
{
	hyc::set<int> a;
	a.insert(1);
	a.insert(2);
	a.insert(3);
	hyc::set<int>::iterator sit = a.begin();
	while (sit != a.end())
	{
		//不支持修改
		cout << *sit<<" ";
		++sit;
	}
	cout << endl;

	hyc::map<int, string> b;
	b.insert({ 1,"huang"});
	b.insert({ 2,"yu"});
	b.insert({ 3,"chi"});
	hyc::map<int, string>::iterator it = b.begin();
	while (it != b.end())
	{
		//不支持修改first,支持修改second
		cout << it->first <<" " << it->second << " ";
		++it;
	}
	cout << endl<<endl;

	hyc::map<int, string>::iterator en = b.end();
	while (en != b.begin())
	{
		//不支持修改first,支持修改second
		--en;
		cout << en->first << " " << en->second << " ";
	}
	cout << endl << endl;


	hyc::map<string, string> dict;
	dict.insert({ "sort", "排序" });
	dict.insert({ "left", "左边" });
	dict.insert({ "right", "右边" });

	dict["left"] = "左边，剩余";
	dict["insert"] = "插入";
	dict["string"];
	for (auto& e : dict)
	{
		cout << e.first << " " << e.second << endl;
	}

}